_Get Random Item from WMU
(19 actions, 29 KB)
0 Dictionary
γβ mappingDict
γΒ»
8
16
{ "Wisdom I Pondered This Week": { "lineOffset": 13, "title": "π Life Wisdom" }, "Things I Learned This Week": { "lineOffset": 21, "title": "π¨π½βπ Lifelong Learner" } }
1 File
γβ Weekly-Mindware-Update
γΒ»
File
:
{ "fileLocation": { "WFFileLocationType": "iCloud", "fileProviderDomainID": "com.apple.CloudDocs.iCloudDriveFileProvider/8CD4A3FB-3479-45CB-829A-CE2FA3119626", "relativeSubpath": "iCloud~md~obsidian/Documents/Second-Brain/Weekly-Mindware-Update", "appContainerBundleIdentifier": "md.obsidian", "crossDeviceItemID": "docs.icloud.com:com.apple.CloudDocs/3438C552-7900-4D1C-BDC5-E1CF43886E3B/29d958dbcf2f63cc9e41b5db4fd1bc1dde45d4ec" }, "filename": "Weekly-Mindware-Update", "displayName": "Weekly-Mindware-Update" }
2 Get Contents of FolderγΒ»
Folder
:
[1 Weekly-Mindware-Update]
Recursive
:
true
3 Filter Files
[2 Get Contents of Folder]
γΒ»
ContentItemFilter
:
β’ All the following are true Name is not README File Extension is md
4 Run Shortcut
_Get Random Item From List
γβ randomWMUFile
γΒ»
5
7
Input
:
[3 Files]
Workflow
:
{ "workflowIdentifier": "E625C6C1-A183-473F-82BB-06827A38FB78", "workflowName": "_Get Random Item From List", "isSelf": false }
5 Match Text
Weekly-Mindware-Update/(.*)
in
[4 randomWMUFile
βs File Path
]
γΒ»
MatchTextCaseSensitive
:
true
6 Get Match Group At Index 1 in
[5 Matches]
γΒ»
17
7 Split Text
[4 randomWMUFile]
by New LinesγΒ»
10
8 Get Dictionary Value for
[Shortcut Input]
.lineOffset
in
[0 mappingDict]
γβ lineOffset
γΒ»
9
10
13
9 Calculate
[8 lineOffset]
+
4
γΒ»
10 Get
Items in Range
[8 lineOffset]
to
[9 Calculation Result]
from List
[7 Split Text]
γβ content
γΒ»
11
12
11 Run Shortcut
_Get Random Index From List
γβ randomIdx
γΒ»
12
13
Input
:
[10 content]
Workflow
:
{ "workflowIdentifier": "68A63D4D-7450-49C4-962F-B7F608B749A8", "workflowName": "_Get Random Index From List", "isSelf": false }
12 Get
Item At Index
[11 randomIdx]
from List
[10 content]
γβ randomItem
γΒ»
14
13 Calculate Expression
[8 lineOffset]
+
[11 randomIdx]
- 1
γΒ»
17
14 Run Shortcut
Get Plain Text from Markdown
γΒ»
Input
:
[12 randomItem]
Workflow
:
{ "workflowIdentifier": "DAB244B1-0299-4B66-A0F1-726F17ED5A84", "workflowName": "Get Plain Text from Markdown", "isSelf": false }
15 Run Shortcut
Strip Leading Symbol
γΒ»
17
Input
:
[14 Shortcut Result]
Workflow
:
{ "workflowIdentifier": "8FC46502-BE99-4573-AE81-F7EBE87C0935", "workflowName": "Strip Leading Symbol", "isSelf": false }
16 Get Dictionary Value for
[Shortcut Input]
.title
in
[0 mappingDict]
γβ title
γΒ»
17 DictionaryγΒ»
{ "filepath": "
[6 Text]
", "item": "
[15 Shortcut Result]
", "line":
[13 Calculation Result]
as Number
, "title": "
[16 title]
" }
18 Stop and Output
[17 Dictionary]